/*
 * WebConfig.java
 * Copyright (c) 2014, 2019, Kiri. 
 * All rights reserved.
 */
package com.onesalt;

import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration.WebMvcAutoConfigurationAdapter;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import com.onesalt.web.api.interceptor.LogInterceptor;
import com.onesalt.web.api.interceptor.LoginInterceptor;

/**
 * 
 *
 * @author kiri
 * @date 2015年4月12日
 * @version 1.0
 */
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcAutoConfigurationAdapter {

	public void addInterceptors(InterceptorRegistry registry) {
		super.addInterceptors(registry);
		registry.addInterceptor(new LoginInterceptor()).addPathPatterns("/api/**").excludePathPatterns("/api/loginBy*").excludePathPatterns("/3rd/*");
		registry.addInterceptor(new LogInterceptor()).addPathPatterns("/api/**");
	}
}
